Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
glsl-specular-beckmann
Advanced tools
Computes the specular power from the Beckmann distribution
#pragma glslify: beckmann = require(glsl-specular-beckmann)
uniform vec3 eyePosition;
uniform vec3 lightPosition;
uniform float roughness;
varying vec3 surfacePosition;
varying vec3 surfaceNormal;
void main() {
vec3 eyeDirection = normalize(eyePosition - surfacePosition);
vec3 lightDirection = normalize(lightPosition - surfacePosition);
vec3 normal = normalize(surfaceNormal);
float power = beckmann(lightDirection, viewDirection, normal, roughness);
gl_FragColor = vec4(power,power,power,1.0);
}
Install with npm:
npm install glsl-specular-beckmann
Then use with glslify.
#pragma glslify: beckmann = require(glsl-specular-beckmann)
float beckmann(vec3 lightDir, vec3 eyeDir, vec3 normal, float shininess)
Computes the specular power in the Beckmann model
lightDir
is a unit length vec3
pointing from the surface point toward the lighteyeDir
is a unit length vec3
pointing from the surface point toward the cameranormal
is the surface normal at the sample pointroughness
is a parameter between 0 and 1 measuring the surface roughness. Small values are shinier, larger values are rougher.Returns A float
representing the specular power
(c) 2014 Mikola Lysenko. MIT License
FAQs
Beckmann specular distribution for GLSL
The npm package glsl-specular-beckmann receives a total of 26,199 weekly downloads. As such, glsl-specular-beckmann popularity was classified as popular.
We found that glsl-specular-beckmann demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.